<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix" style="text-align: center;line-height: 30px">
        <h3>出库信息详情</h3>
      </div>
    <el-row>
      <el-col :span="12"><div class="grid-content bg-purple">
        <span>客户名称:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <span>{{clientName}}</span>
      </div></el-col>
      <el-col :span="12"><div class="grid-content bg-purple-light">
        <span>销售员:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <span>{{salePerson}}</span>
      </div></el-col>
    </el-row>
    <br>
    <el-row>
      <el-col :span="12"><div class="grid-content bg-purple">
        <span>销售日期:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <span>{{saleTime}}</span>
      </div></el-col>
      <el-col :span="12"><div class="grid-content bg-purple-light">
        <span>订单金额:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <span>{{saleAllMoney}}</span>
      </div></el-col>
    </el-row>
    <br>
    <el-row>
      <el-col :span="12"><div class="grid-content bg-purple">
        <span>送货地址:&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <span>{{saleAddress}}</span>
      </div></el-col>
    </el-row>
    <br>
    <el-row>
      <el-col :span="12"><div class="grid-content bg-purple">
        <span>出库物品明细</span>
      </div></el-col>
    </el-row>
    <el-row>
      <el-col :span="24"><div class="grid-content bg-purple">
          <el-table
              :data="tableDate"
              stripe
              style="width: 100%">
            <el-table-column
                prop="goodsName"
                label="商品名称"
                width="240">
            </el-table-column>
            <el-table-column
                prop="goodsFactory"
                label="厂家"
                width="240">
            </el-table-column>
            <el-table-column
                prop="finalSellPrice"
                label="成交价"
                width="240">
            </el-table-column>
            <el-table-column
                prop="stockNumber"
                label="货物数量"
                width="240">
            </el-table-column>
          </el-table>
      </div></el-col>
    </el-row>
    <br>
    <el-row>
      <el-col :span="24"><div class="grid-content bg-purple" style="text-align: center;line-height: 20px">
        <el-button type="primary" @click="onSubmit">确定</el-button>
      </div></el-col>
    </el-row>
    </el-card>
  </div>
</template>

<script>
export default {

  name: "SaleList",

  data(){
    return{
      clientName:'',
      salePerson:'',
      saleAllMoney:'',
      saleAddress:'',
      saleTime:'',
      tableDate:[],
      list:'',
      customName:'',
      employeeName:'',
      money:'',

    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init(){
      //出库信息详情
      let sellId = this.$store.state.sellId

      let url = "api/sell/findById?sellId="+sellId
      this.$axios.get(url).then(r=>{
        console.log(r.data)

        let datas = r.data
        this.clientName = datas.customName
        this.salePerson = datas.employeeName
        this.saleTime = datas.date
        this.saleAllMoney = datas.money
        this.saleAddress = datas.address
        this.tableDate = datas.list
      })
    },
    onSubmit() {
      //调用父组件的关闭方法
      this.$router.push("SalesInfoView")
    }
  }
}
</script>

<style scoped>

</style>